# -*- mode:Makefile -*-
MODULE=BlackPine
SWIG=swig
OS = $(shell perl -e 'print ucfirst($$^O);')

ifeq ($(OS), Cygwin)
LIBSFX = dll
else
LIBSFX = so
endif

ifeq ($(OS), Freebsd)
MAKE = gmake
else
MAKE = make
LDFLAGS+=-ldl 
endif

VER=0.3.1
GCC_VER=$(shell g++ -dumpversion | grep -o -e '[0-9]\+\.[0-9]\+' | sed 's/\.//g')
BOOST_VER=1.34.1
BOOST_VER:=$(shell echo $(BOOST_VER) | sed 's/\./_/g')
# BOOST_DIR=$(HOME)
BOOST_DIR=/usr/local
BOOST_INC=$(BOOST_DIR)/include/boost-$(BOOST_VER)
BOOST_LIB=$(BOOST_DIR)/lib
CXXFLAGS+=-O2 -g -Wall -I. -I./ext -fPIC -D$(OS) -DBP_VERSION=\"$(VER)\" -I$(BOOST_INC)
LDFLAGS+=-L$(BOOST_LIB) -lboost_regex-gcc$(GCC_VER)-$(BOOST_VER)
QUOTE_CXXFLAGS=$(shell echo ${CXXFLAGS} | sed 's/\"/\\\\\\\"/g')
CLEANOBJ=*~ *.o *.$(LIBSFX) main *_wrap.cpp
DISTCLEANOBJ=*~ *.o *.$(LIBSFX)

all: do
clean:
	rm -rf $(CLEANOBJ)
distclean:
	rm -rf $(DISTCLEANOBJ)
